<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Tournament Info</title>
    </h:head>
    <h:body>
        <ui:include src="header.xhtml"/>
        <hr/>
        <h:messages style="color: red"> </h:messages>
        <h:panelGrid columns="5" border="0">
            <h:form>
                <h:dataTable value="#{mainPageManagedBean.selectedTournament}" var ="item" border="0"  rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Name"/>
                        </f:facet>
                        <h:outputText value="#{item.name}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Type"/>
                        </f:facet>
                        <h:outputText value="#{item.type}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Start Date"/>
                        </f:facet>
                        <h:outputText value="#{item.startDate}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="End Date"/>
                        </f:facet>
                        <h:outputText value="#{item.endDate}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Prize"/>
                        </f:facet>
                        <h:outputText value="#{item.prize}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
            <h:form>
                <h:dataTable value="#{mainPageManagedBean.selectedTournament.referees}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Referees"/>
                        </f:facet>
                        <h:outputText value="#{item}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
            <h:form>
                <h:dataTable value="#{mainPageManagedBean.selectedTournament.umpires}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Umpires"/>
                        </f:facet>
                        <h:outputText value="#{item}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
            <h:form>
                <h:dataTable value="#{mainPageManagedBean.selectedTournament.courts}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Courts"/>
                        </f:facet>
                        <h:outputText value="#{item.name}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
            <h:form>
                <h:dataTable value="#{mainPageManagedBean.selectedTournament.teams}" var="item" border="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Teams"/>
                        </f:facet>
                        <h:outputText value="#{item}"/>
                    </h:column>
                </h:dataTable>
            </h:form>
        </h:panelGrid>
        <hr/>
        <h:panelGrid columns="2" border="0">
            <f:view>
                <h:form>
                    <h:dataTable value="#{mainPageManagedBean.matches}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="HomeTeam"/>
                            </f:facet>
                            <h:outputText value="#{item.homeTeam}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="AwayTeam"/>
                            </f:facet>
                            <h:outputText value="#{item.awayTeam}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="AwayTeamScore"/>
                            </f:facet>
                            <h:outputText value="#{item.awayTeamScore}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="HomeTeamScore"/>
                            </f:facet>
                            <h:outputText value="#{item.homeTeamScore}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Court"/>
                            </f:facet>
                            <h:outputText value="#{item.court}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="mDate"/>
                            </f:facet>
                            <h:outputText value="#{item.mDate}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="mTime"/>
                            </f:facet>
                            <h:outputText value="#{item.mTime}"/>
                        </h:column>
                        <h:column>
                            <h:commandLink value="Details" action="#{mainPageManagedBean.matchDetails(item)}"/>
                        </h:column>
                    </h:dataTable>
                </h:form>
            </f:view>
        </h:panelGrid>
    </h:body>
</html>

